import { handleActions } from 'redux-actions';

import{ realtime } from "../common/state.jsx";
import { REALTIME_CONNECT, REALTIME_SUBSCRIBE, REALTIME_UNSUBSCRIBE, REALTIME_MESSAGE } from "../action/realtime";

export default handleActions({
    REALTIME_CONNECT:  (state, action) => state.set("connect", action.payload),
    REALTIME_TRACING: (state, action) => state.set("tracing", action.payload),
    REALTIME_SUBSCRIBE: (state, action) => state.set("subscribe", action.payload),
    REALTIME_UNSUBSCRIBE: (state, action) => state.set("unSubscribe", action.payload),
    REALTIME_MESSAGE: (state, action) => state.set("message", action.payload)
}, realtime);
